#include<cstdio>
#include<stdlib.h>
#include<my_global.h>
#include<mysql.h>
#include"GUI.h"
#include"systems.h"
using namespace std;
MYSQL *mysql;
int main(int argc, char *argv[])
{
	mysql = mysql_init(NULL);
	int sc;
	if(mysql == NULL)
	{
		printf("error 1\n");
		fprintf(stderr, "%s\n", mysql_error(mysql));
		return 1;
	}
	if(NULL == mysql_real_connect(mysql, "localhost", "root", "asd4466911", "MYDB", 0, NULL, 0))
	{
		printf("error 2");
		fprintf(stderr, "%s\n", mysql_error(mysql));
	}
	while(1)
	{
		system("clear");
		GUI_1();
		scanf("%d",&sc);
		switch(sc)
		{
			case 1:
				system_1();
				break;
			case 2:
				system_2();
				break;
			case 3:
				system_3();
				break;
			case 4:
				printf("再见！\n");
				exit(1);
				break;
		}
	}
	mysql_close(mysql);	
}
